﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.Master" AutoEventWireup="true" CodeBehind="BookOfDepart.aspx.cs" Inherits="MyHospital.web.Booking" EnableEventValidation="false" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link href="Styles/book.css" rel="stylesheet" />
    <style>
       /* .depart tbody tr {
            height:34px;
        }*/
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <script lang="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
    <div class="depart">   
    <input id="inp1" class="inp1" type="text" value="请输入科室" runat="server" /><asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="搜索" />
    <input id="inp2" class="inp2" type="text" value="请选择就诊日期" runat="server" onclick="WdatePicker({ dateFmt: 'yyyy-MM-dd', minDate: '%y-%M-%d', maxDate: '%y-%M-{%d+6}' })" />
    <asp:GridView Width="355px" Height="400px" ID="GridView1" runat="server" OnPageIndexChanging="GridView1_PageIndexChanging" AllowPaging="True" AllowSorting="True" PageSize="12" AutoGenerateColumns="False" DataKeyNames="departId" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
        <Columns>
            <asp:BoundField DataField="departName" HeaderText="科室名称" SortExpression="departName" ControlStyle-Width="266px" />
            <asp:TemplateField>   
           <ItemTemplate>   
                   <asp:Button    ID="Button1"    runat="server"    OnClick="Button1_Click"   Text="查看"    />   
           </ItemTemplate>   
   </asp:TemplateField>   
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:MyHospitalConnectionString %>" SelectCommand="SELECT [departName], [departId] FROM [Department]"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:MyHospitalConnectionString %>" SelectCommand="SELECT [departName] FROM [Department]"></asp:SqlDataSource>
    </div>
   <script>
       var input = document.querySelector('.inp1');
       var input1 = document.querySelector('.inp2');
       var but = document.querySelector('#Button1');
       but.addEventListener('click', function () {
           if (input1.value == '请选择就诊日期' || input1.value == '') {
               alert("请选择就诊日期!")
           }
       })
       input.onfocus = function () {
           if (this.value == '请输入科室') {
               this.value = '';
           }
       }
       input.onblur = function () {
           if (this.value == '') {
               this.value = "请输入科室"
           }
       }
       input1.onfocus = function () {
           if (this.value == '请选择就诊日期') {
               this.value = '';
           }
       }
       input1.onblur = function () {
           if (this.value == '') {
               this.value = "请选择就诊日期"
           }
       }
   </script>
    </asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <div class="doc">
        <asp:DataList ID="DataList1" runat="server" RepeatColumns="7" RepeatDirection="Horizontal" Width="120px">
        <ItemTemplate>
            <div class="item">
             <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl='<%# Eval("image") %>' OnCommand="ImageButton1_Command" CommandArgument='<%# Eval("doctorId") %>' />
            <br />
            <asp:Label ID="Label1" runat="server" Text='<%# Eval("doctorName") %>' ></asp:Label>
            <br />
            <asp:Label ID="Label2" runat="server" Text='<%# Eval("job") %>' ></asp:Label>
            <br />
            <asp:Label ID="Label3" runat="server" Text="——————"></asp:Label>
            <br />
            <asp:Label ID="Label4" runat="server" Text='<%# Eval("introduce") %>' ></asp:Label>
            </div> 
        </ItemTemplate>
    </asp:DataList>
    </div>
    
</asp:Content>